package com.example.riceexambackend.dao.mapper;

import com.example.riceexambackend.dao.dataobject.AnswerDO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

@Mapper
public interface AnswerMapper {

    /**
     * 插入作答记录
     * @param answerDO
     */
    @Insert("insert into t_answer (exam_id, user_id, question_id, user_answer) values (#{examId}, #{userId}, #{questionId}, #{userAnswer})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void insertAnswer(AnswerDO answerDO);

}
